package com.dk.service.impl;

import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dk.mapper.CarMapper;
import com.dk.pojo.Tbcar;
import com.dk.pojo.Tbcities;
import com.dk.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CarServiceimpl implements CarService {
    @Autowired
    private CarMapper carmapper;
    @Override
    public Tbcar getprice(String modelsId) {
        /*java8新特性 方法的引用*/
        LambdaQueryWrapper<Tbcar> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        LambdaQueryWrapper<Tbcar> eq = lambdaQueryWrapper.eq(!StringUtils.isEmpty(modelsId),Tbcar:: getModelsId, modelsId);
        Tbcar tbcar = carmapper.selectOne(eq);
        return tbcar;
    }
}
